<template>
  <div id="app">
    <!-- 标题栏 -->
    <div class="title-bar">
      <div class="back-arrow">
        <svg
          t="1747792003449"
          class="icon"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          width="25.5"
          height="25.5"
          @click="goBack"
        >
          <path
            d="M658.24 210.304H292.544V64L0 283.456l292.544 219.456V356.544H658.24c124.352 0 219.52 95.04 219.52 219.456s-95.104 219.456-219.52 219.456H292.544V941.76H658.24C855.744 941.76 1024 780.8 1024 576S863.104 210.304 658.24 210.304z"
            fill="#2c2c2c"
          />
        </svg>
      </div>
      <h2>打卡记录</h2>
    </div>

    <!-- 打卡记录列表 -->
    <div class="record-list">
      <div
        v-for="record in checkInRecords"
        :key="record.id"
        class="record-item"
      >
        <div class="record-date">
          {{ record.date }}
        </div>
        <div class="record-meal">
          {{ record.meal }}
        </div>
        <div :class="['record-status', record.status]">
          {{ record.status }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import { ref } from 'vue';

// export default {
//   name: 'CheckInRecords',
//   setup () {
//     const checkInRecords = ref([
//       { id: 1, date: '2025.10.1', meal: '早餐', status: '完成' },
//       { id: 2, date: '2025.10.1', meal: '午餐', status: '完成' },
//       { id: 3, date: '2025.10.1', meal: '晚餐', status: '未完成' },
//       { id: 4, date: '2025.10.2', meal: '早餐', status: '完成' },
//       { id: 5, date: '2025.10.2', meal: '午餐', status: '完成' },
//       { id: 6, date: '2025.10.2', meal: '晚餐', status: '未完成' },
//       { id: 7, date: '2025.10.3', meal: '早餐', status: '完成' },
//       { id: 8, date: '2025.10.3', meal: '午餐', status: '完成' },
//       { id: 9, date: '2025.10.3', meal: '晚餐', status: '未完成' },
//     ]);

//     // 返回按钮点击事件
//     const goBack = () => {
//       uni.navigateBack();
//     };

//     return {
//       checkInRecords,
//       goBack,
//     };
//   },
// };
</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  color: #2c3e50;
  padding: 0;
  margin: 0;
  background-color: white;
}

/* 标题栏样式 */
.header {
  background-color: #ff66b2;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-button {
  display: flex;
  align-items: center;
  color: white;
  cursor: pointer;
}

.arrow {
  font-size: 20px;
  margin-right: 5px;
}

.back-text {
  font-size: 16px;
}

.header h1 {
  margin: 0;
  font-size: 18px;
  color: white;
}

/* 打卡记录列表样式 */
.record-list {
  padding: 15px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.record-date {
  color: #33cc33;
  flex: 1;
}

.record-meal {
  flex: 1;
}

.record-status {
  flex: 1;
  text-align: right;
}

.title-bar {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.back-arrow {
  margin-right: 10px;
}

</style>
